gusucode.com > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM源码程序 > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM\stprtool\generalp\knnclass.m

    % KNNCLASS k-Nearest Neighbours classifier.
% [tst_labels] = knnclass(tst_data,trn_data,trn_labels, k)
%
% Input:
%  tst_data [dim x n_tst] data to be classified.
%  trn_data [dim x n_trn] training data.
%  trn_labels [ 1 x n_trn] labels of training data.
%  k [int] number of neighbours.
% 
% Output:
%  tst_labels [1 x n_tst] estimated labels of testing data.
%

% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac
% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz
% Written Vojtech Franc (diploma thesis) 02.11.1999, 13.4.2000 
% Modifications
% 18-sep-2002, V. Franc